package de.parsemis.algorithms.dagpSpan;

import java.util.Collection;
import java.util.Iterator;
import java.util.TreeSet;

import de.parsemis.miner.chain.SearchLatticeNode;
import de.parsemis.miner.environment.LocalEnvironment;
import de.parsemis.miner.general.Frequency;

public class GSpanPatternExtender<NodeType, EdgeType> extends
		GSpanExtender<NodeType, EdgeType> {

	protected Collection<SearchLatticeNode<NodeType, EdgeType>> childrenPatterns;
	
	public GSpanPatternExtender(GThreadEnvironment<NodeType, EdgeType> tenv) {
		super(tenv);
		// TODO Auto-generated constructor stub
	}

	/**
	 * FIXME：修改GSpan的子模式扩展方法
	 */
	public Collection<SearchLatticeNode<NodeType, EdgeType>> getChildren(
			final SearchLatticeNode<NodeType, EdgeType> node) {
		assert(node instanceof DFSCodePattern);
		// ArrayList for deteministic search
		children = new TreeSet<SearchLatticeNode<NodeType, EdgeType>>();
		dummy.clear();
		// start the run throu the chain for the given node
		first.call(node, dummy);
		return children;
	}
}
